package com.das.mechanic_base.widget;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.das.mechanic_base.R;
import com.das.mechanic_base.app.X3AppRouterConstants;
import com.das.mechanic_base.app.X3RouterCenter;
import com.umeng.analytics.MobclickAgent;

/**
 * 新用户引导
 */
public class X3WelcomeNoviceDialog extends Dialog implements View.OnClickListener {

    private Button btn_study;
    private ImageView iv_dis;
    private Activity activity;

    public X3WelcomeNoviceDialog(@NonNull Activity context) {
        super(context, R.style.pointDialog);
        activity = context;
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.x3_welcome_novice_dialog);
        setCancelable(false);
        initView();
    }

    private void initView() {
        btn_study = findViewById(R.id.btn_study);
        iv_dis = findViewById(R.id.iv_dis);
        btn_study.setOnClickListener(this);
        iv_dis.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.btn_study) {
            dismiss();
            X3RouterCenter.startNavigate(X3AppRouterConstants.Router.USE_APP,null);
//            activity.startActivity(new Intent(activity, UseAppActivity.class));
        } else if (id == R.id.iv_dis) {
            dismiss();
        }
    }
    @Override
    protected void onStart() {
        super.onStart();
        MobclickAgent.onPageStart("欢迎新用户弹窗");
    }

    @Override
    protected void onStop() {
        super.onStop();
        MobclickAgent.onPageEnd("欢迎新用户弹窗");
    }
}
